package com.pearl.security.multiloginreject.demo.session.redis;

import org.springframework.context.annotation.Import;
import org.springframework.session.FlushMode;
import org.springframework.session.SaveMode;
import org.springframework.session.data.redis.config.annotation.web.http.RedisIndexedHttpSessionConfiguration;

import java.lang.annotation.*;

/**
 * @author TD
 * @version 1.0
 * @date 2024/5/15
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Documented
@Import({MyRedisIndexedHttpSessionConfiguration.class})
public @interface MyEnableRedisIndexedHttpSession {
    int maxInactiveIntervalInSeconds() default 1800;

    String redisNamespace() default "spring:session";

    FlushMode flushMode() default FlushMode.ON_SAVE;

    SaveMode saveMode() default SaveMode.ON_SET_ATTRIBUTE;

    String cleanupCron() default "0 * * * * *";
}